/*EmcF6YoLVay1mDO5/p7757rIkUTZxca6GKNzhqG5K0q7pCV1AQ9u3bvh1cZqSP3+*/

import { fiterDefdoc } from "../../../../../arap/common/util/fiterUtils";

/**
 * 多使用部门编辑前
 * @param props
 * @param moduleId
 * @param key
 * @param value
 * @param index
 * @param record
 * @param status
 * @return {boolean}
 */
export default function bodyBeforeEvent(props, moduleId, key, value, index, record, status) {
    let meta = props.meta.getMeta();
    if(key == 'def1'){//管理科目

        //获取表单中的利润中心名称
        let def9 = props.form.getFormItemsValue('asset', 'def9').value;
        let where = "def1 in (select pk_org from org_orgs where dr=0 and name in (select name from org_orgs where pk_org='"+def9+"')) and def7='Y'";

        fiterDefdoc(props, moduleId, key, where);
    }
    return true;
}
/*EmcF6YoLVay1mDO5/p7757rIkUTZxca6GKNzhqG5K0q7pCV1AQ9u3bvh1cZqSP3+*/